<template>
	<view class="goodsList">
		<view class="title">
			共{{item.buyNum}}件商品
		</view>
		<view class="row" v-for="i in item.carList">
			<view class="left">
				<image :src="i.picurls" mode="aspectFill"></image>
				<view class="name">
					{{i.name}}
				</view>
			</view>
			<view class="center">
				×{{i.numvalue||i.num}}
			</view>
			<view class="right">
				<view class="big">
					￥{{i.price}}
				</view>
				<view class="small" v-if="i.preprice>0">
					￥{{i.preprice}}
				</view>
			</view>
		</view>
		<view class="total">
			<text v-if="item.cheap!=0">【已优惠￥{{item.cheap}}】</text>合计 <text class="big">￥{{item.totalPrice}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "goodsList",
		props: {
			item: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {
				cheap: 3,
			};
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.goodsList {
		background: #fff;
		padding: 30rpx;
		border-radius: 0 0 30rpx 30rpx;

		.title {
			font-size: 38rpx;
		}

		.row {
			@include flex-box();
			padding: 25rpx 0;

			.left {
				@include flex-box();
				width: 400rpx;

				image {
					width: 64rpx;
					height: 64rpx;
				}

				.name {
					padding: 0 0 0 15rpx;
					flex: 1;
					font-size: 30rpx;
				}
			}

			.center {
				width: 100;
				text-align: center;
			}

			.right {
				flex: 1;
				text-align: right; //文本水平对齐方式
				font-weight: bold;

				.big {
					font-size: 34rpx;
				}

				.small {
					font-size: 22rpx;
					color: $text-font-color-3;
					text-decoration: line-through;
				}
			}
		}

		.total {
			padding: 30rpx 0;
			text-align: right;
			font-size: 30rpx;
			color: $text-font-color-2;

			.big {
				font-size: 36rpx;
				font-weight: bold;
				color: $price-color;
			}
		}
	}
</style>
